//
//  BindDeviceViewController.m
//  NuwaRobot
//
//  Created by Kendama on 2017/12/5.
//  Copyright © 2017年 Kendama. All rights reserved.
//

#import "BindDeviceViewController.h"
#import "BindDeviceView.h"
#import "ScanDeviceViewController.h"

@interface BindDeviceViewController ()

@property(nonatomic,strong) BindDeviceView *containerView;

@end

@implementation BindDeviceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
}

- (void)didClickScanButton
{
    ScanDeviceViewController *vc = [ScanDeviceViewController new];
    [self.navigationController pushViewController:vc animated:YES];
}

- (BindDeviceView *)containerView
{
    if(!_containerView)
    {
        UIView *superView = self.view;
        _containerView = [[BindDeviceView alloc]init];
        [superView addSubview:_containerView];
        [_containerView.scanButton addTarget:self action:@selector(didClickScanButton) forControlEvents:UIControlEventTouchUpInside];
    }
    return _containerView;
}

- (void)masLayoutSubview
{
    __weak UIView *superView = self.view;
    [self.containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(superView.mas_top).with.offset(64);
        make.left.right.bottom.mas_equalTo(superView);
    }];
}

- (void)setNavigationStyle
{
    [self setNavigationBarTitle:@"绑定新设备"];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
